package com.coder.friend.dao;

import com.coder.friend.pojo.Friend;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
 * @BelongsProject:coder_parent
 * @BelongsPackage:com.coder.friend.dao
 * @Author:linchong
 * @CreateTime:2019-01-19 14:48
 * @Description:
 */
public interface FriendDao extends JpaRepository<Friend,String> {
    public Friend findByUseridAndFriendid(String userid,String friendid);

    @Modifying
    @Query(value="UPDATE tb_friend SET isLike = ? WHERE userid = ? AND friendid =?",nativeQuery = true)
    public void updateIslike(String isLike,String userid,String  friendid);

    @Modifying
    @Query(value="DELETE  from tb_friend WHERE userid = ? AND friendid =?",nativeQuery = true)
    public void deletefriend(String userid, String friendid);
}











